<template>
	<view class="shop_paid">
		<u-navbar title="订单信息" @rightClick="rightClick" :autoBack="true">
		</u-navbar>
		<view class="paid_main">
			<view class="paid_list">
				<!-- <view class="paid_tab">
					<view class="paid_img">
						<image src="../../static/img/demo.webp" mode=""></image>
					</view>
					<view class="tab_desc">
						<view class="desc_top">商品名称</view>
						<view class="desc_center">商品信息</view>
						<view class="desc_bottom">数量</view>
					</view>
					<view class="tab_btn">
						去支付
					</view>
				</view> -->
				<u-empty mode="order" v-if="paidList.length==0" icon="http://cdn.uviewui.com/uview/empty/car.png">
				</u-empty>
				<view class="paid_tab" v-for="item in paidList">
					<view class="paid_img">
						<image :src="item.img" mode=""></image>
					</view>
					<view class="tab_desc">
						<view class="desc_top">{{item.title}}</view>
						<view class="desc_center">{{item._id}}</view>
						<view class="desc_bottom">数量 {{item.count}}</view>
					</view>
					<view class="tab_btn" @click="jumpOrder(item._id)">
						去支付
					</view>
				</view>

			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				paidList: []
			};
		},
		onShow() {
			uniCloud.callFunction({
				name: "user_shop_bag",
				data: {
					item_id: uni.getStorageSync("_id"),
					type: 0
				}
			}).then((res) => {
				this.paidList = res.result
				console.log(this.paidList)
			})
		},
		methods: {
			rightClick() {
				console.log('rightClick');
			},
			leftClick() {
				console.log('leftClick');
			},
			jumpOrder(_id) {
				let dd = []
				dd.push(_id)
				uni.setStorageSync("shop_id", dd)
				uni.navigateTo({
					url: "/pages/order/order"
				})
				console.log(_id)
			}
		}
	}
</script>

<style lang="scss">
	.shop_paid {
		padding-bottom: 10px;
		background-color: #f2f3f3;
		min-height: 99vh;
		color: #333;

		.tab_btn {
			margin-top: 70px;
			background-color: #ff78a2;
			color: white;
			padding: 4px 10px;
			font-size: 14px;
			border-radius: 8px;
		}

		.paid_main {
			margin: 65px 20px 0;

			.paid_list {
				height: 100%;
				width: 100%;

				.paid_tab {
					background-color: white;
					border-radius: 8px;
					height: 120px;
					width: 100%;
					margin-bottom: 20px;
					display: flex;
					align-items: center;

					.paid_img {
						width: 100px;
						height: 100px;
						margin-left: 10px;

						image {
							height: 100%;
							width: 100%;
							border-radius: 12px;
						}
					}

					.tab_desc {
						margin-left: 10px;
						width: 140px;

						.desc_top {
							text-overflow: ellipsis;
							overflow: hidden;
							white-space: nowrap;
						}

						.desc_center {
							margin-top: 10px;
							color: #999;
							font-size: 13px;
							font-weight: 100;
							text-overflow: ellipsis;
							overflow: hidden;
							white-space: nowrap;
						}

						.desc_bottom {
							margin-top: 10px;
							font-size: 13px;
							font-weight: 100;
						}

					}
				}
			}
		}
	}
</style>